import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../common/routes/app_pages.dart';


class GameMenu extends StatelessWidget {
  GameMenu({Key? key}) : super(key: key);
  final url = 'start'.obs;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('TJ Web View', style: TextStyle(fontSize: 34),textAlign: TextAlign.center,),
          backgroundColor: Color.fromRGBO(154, 223, 217, 0.961),
        ),
        body: Padding(
          padding: EdgeInsets.all(24),
          child: Center(
              child: ListView(
            children: <Widget>[
              SizedBox(
                width: 200,
                height: 100,
                child: ElevatedButton(
                    child: Text('open creator', style: TextStyle(fontSize: 24),),
                    onPressed: () async {
                      var result = await Get.toNamed(AppRoutes.Cocos);
                      url.value = result["success"].toString();
                    }),
              ),
              SizedBox(
                height: 30,
              ),
              SizedBox(
                width: 200,
                height: 100,
                child: ElevatedButton(
                    child: Text('open flame', style: TextStyle(fontSize: 24),),
                    onPressed: () async {
                      var result = await Get.toNamed(AppRoutes.Flame);
                      url.value = result["success"].toString();
                    }),
              ),
              SizedBox(
                height: 30,
              ),
              SizedBox(
                width: 200,
                height: 100,
                child: ElevatedButton(
                    child: Text('open view', style: TextStyle(fontSize: 24),),
                    onPressed: () async {
                      var result = await Get.toNamed(AppRoutes.Home1);
                      url.value = result["success"].toString();
                    }),
              ),
              SizedBox(
                height: 30,
              ),
              SizedBox(
                width: 200,
                height: 100,
                child: ElevatedButton(
                    child: Text('open tank', style: TextStyle(fontSize: 24),),
                    onPressed: () async {
                      var result = await Get.toNamed(AppRoutes.Tank);
                      url.value = result["success"].toString();
                    }),
              )
            ],
          )),
        ));
  }
}
